<!DOCTYPE html>
<html lang="en">
    <head>
        <meta http-equiv="x-ua-compatible" content="ie=edge">
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width,initial-scale=1">
        <title>我</title>
        <link rel="stylesheet" href="me.css">
        <link rel="stylesheet" href="normalize.css">
        <script src="../public/jquery.min.js"></script>
        <script src="picturefill.js"></script>
        <script src="../layer.js"></script>
    </head>
    <body>
        <style>
            #header_name {
                font-family: "微软雅黑" ; font-weight:normal; letter-spacing: 2px;
            }
        </style>
        <header>
            <div class="portrait" style="  width: 6.5rem;height: 6.5rem;display: flex;background: #fff;justify-content: center;align-items: center;border-radius: 50%;">
                <img class='photo' src='http://image.icandrive.cn/herderimg.jpg' style="width:6rem; height: 6rem;    border-radius: 50%;">
            </div>
            <div class="signature">
                <h1 id="header_name">学员</h1>
                <!--		<h2 contenteditable="true" style="font-size: 0.6rem;font-family: cursive">未设置</h2>-->
            </div>
            <div class="wenzi">
                <!-- <button>签到</button> -->

            </div>
        </header>
        <section>
            <div  class="myItems"  id="self" onclick="window.location.href='../own_set/student_lianxi.html'"><img src="geren.png" alt="该图片未加载成功"><span>个人资料</span></div>
            <div  class="myItems"  id="sign"><img src="sign_up_me.png" alt="该图片未加载成功"><span>我的报名</span></div>
            <div class="myItems" id="kaoshi"  onclick="window.location.href='exam.html'"><img src="exam.png" alt="该图片未加载成功"><span>我要考试</span></div>
            <div class="myItems" onclick="window.location.href='../upload_infomation/exam_site.html'" id="cailiao"><img src="sign_info.png" alt="该图片未加载成功"><span>提交资料</span></div>
            <div class="myItems" id="info"><img src="realName.png" alt="该图片未加载成功"><span>实名认证</span></div>
            <div class="myItems" id="coach"><img src="coach_apply.png" alt="该图片未加载成功"><span>教练申请</span></div>
            <div class="myItems" id="coach" onclick="window.location.href='../address/yiyuan.html'"><img src="hospital.png" alt="该图片未加载成功"><span>体检医院</span></div>
            <div class="myItems" id="songkao"><img src="send_test.png" alt="该图片未加载成功"><span>送考预约</span></div>
            <div onclick="window.location.href='../integral/integral.html'" class="myItems"><img src="my_point.png" alt="该图片未加载成功"><span>积分商城</span></div>
            <div onclick="my_jifen()" class="myItems"><img src="my_point.png" alt="该图片未加载成功"><span>我的积分</span></div>

            <div class="myItems"id="xxxxx" ><img src="his_records.png" alt="该图片未加载成功"><span >注销</span></div>
            <script>
                $("#xxxxx").click(function(){

                    localStorage.removeItem("savalogintooken");
                    localStorage.removeItem('phone');
                    window.location.href= "../login/log_in.html";
                });
            </script>

        </section>
        <footer>
            <ul class="footer_list">
                <li onclick="window.location.href='../index/index.html'" class="footer_list_num1">
                    <img src="study_drive_off.png" alt="学车">
                </li>
                <li class="footer_list_num2">
                    <img src="oderForm_off.png" alt="订单">
                </li>
                <li   onclick="window.location.href='../lianti/index.html'" class="footer_list_num3">
                    <img src="practice_off.png" alt="练题">
                </li>
                <li class="footer_list_num4">
                    <img src="me_on.png" alt="我">
                </li>
            </ul>
        </footer>

        <script >
            $("#xxxxx").click(function(){
                /*alert(1);*/
                localStorage.removeItem("savalogintooken");
                localStorage.removeItem('phone');
                window.location.href="../login/log_in.html";

            });


            $(function(){
                var token=localStorage.phone;
                $.ajax({
                    url:'https://newapp.icandrive.cn/api/student_me.php',
                    type:'post',
                    dataType:'json',
                    data:{token:token},
                    success:function(data){
                        console.log(data);
                        if(data.status==200){
                            $(data.list).each(function(){
                                $('.signature h1').html(this.user_name);
                                $('.photo').attr('src',this.photo);
                            })
                        }

                        if(data.status==400){
                            layer.msg("您还未实名认证哟！");
                            /*setInterval(function () {
					window.location.href = "../info/information.html"
				}, 2000)*/
                        }
                    },
                    error:function(){
                        layer.msg('系统维护中',function(){
                            history.go(0)
                        },1000);
                    }

                });

            })
            $("#sign").click(function(){
                var token = localStorage.phone;
                $.ajax({
                    url:'https://newapp.icandrive.cn/api/school.php',
                    type:'post',
                    dataType:'json',
                    data:{token:token},
                    success:function(data){
                        if(data.status==250){
                            lay.msg("请重新登陆");
                            setInterval(function(){
                                window.location.href="../login/log_in.html";
                            },2000);
                        }
                        if(data.status==200){
                            window.location.href="../mytest/sign_up.html";
                        }
                        if(data.status==400){
                            layer.msg("你还没有报名哟");
                        }
                    },
                    error:function(){
                        layer.msg('系统维护中',function(){
                            history.go(0)
                        },1000);
                    }

                });
            });


            $("#songkao").click(function(){
                var token=localStorage.phone;
                $.ajax({
                    url:'https://newapp.icandrive.cn/api/checkorder.php',
                    type:'post',
                    dataType:'json',
                    data:{token:token},
                    success: function (data) {
                        if(data.status==200){

                            window.location.href="../send/send-test.html";

                        }
                        else if(data.status==300){
                            layer.msg('还未约考，无法送考预约');
                        }
                        else if(data.status == 400){
                            layer.msg("该校暂不支持送考预约");
                        }
                    },
                    error: function () {
                        layer.msg('系统维护中',function(){
                            /*history.go(0)*/
                        },1000);
                    }
                })
            });
            $("#info").click(function(){

                var token = localStorage.phone;
                $.ajax({
                    url: "https://newapp.icandrive.cn/api/realName.php",
                    type: 'post',
                    data: {token: token},
                    dataType: 'json',
                    success: function (data) {
                        if (data.status == 200) {

                            layer.msg('你已实名认证过了');
                        }
                        if (data.status == 250) {
                            layer.msg("请重新登录");
                            setInterval(function () {
                                window.location.href = "../login/log_in.html";
                            }, 2000)
                        }
                        if (data.status == 400) {
                            window.location.href="../info/information.html";
                        }
                    },
                    error: function () {
                        layer.msg('系统维护中',function(){
                            history.go(0)
                        },1000);
                    }
                });

            });
            $("#cailiao").click(function(){

            });
            $("#coach").click(function(){
                window.location.href="../info/coach_register.html";
            });
            $('.footer_list_num2').click(function () {
                window.location.href='../studentorder/oder.html';
            })


            /*我的积分点击事件*/
            function my_jifen() {
                layer.msg("暂未开放");
            }

        </script>

        <script>
            document.addEventListener("plusready", function() {
                // 注册返回按键事件
                plus.key.addEventListener('backbutton', function() {
                    // 事件处理
                    plus.nativeUI.confirm("退出程序？", function(event) {
                        if (event.index) {
                            plus.runtime.quit();
                        }
                    }, null, ["取消", "确定"]);
                }, false);
            });

        </script>
    </body>
</html>
